package com.hs.jhzd.controller;

import com.hs.jhzd.entity.YlSnjyxxbEntity;
import com.hs.jhzd.entity.YlSwjyjlbEntity;
import com.hs.jhzd.repository.YlSnjyxxbRepository;
import com.hs.jhzd.repository.YlSwjyjlbRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/jyjl")
@Slf4j
public class JyjlController {

    @Autowired
    private YlSnjyxxbRepository ylSnjyxxbRepository;
    @Autowired
    private YlSwjyjlbRepository ylSwjyjlbRepository;




    @RequestMapping("/sw")
    @ResponseBody
    public List<YlSwjyjlbEntity> sw(String rybh) {
        List<YlSwjyjlbEntity> allByRybh = ylSwjyjlbRepository.findAllByRybh(rybh);
        return allByRybh;
    }
    @RequestMapping("/sn")
    @ResponseBody
    public List<YlSnjyxxbEntity> sn(String rybh) {
        List<YlSnjyxxbEntity> allByRybh = ylSnjyxxbRepository.findAllByRybh(rybh);
        return allByRybh;
    }




}
